<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <link rel="icon" href="favicon.ico" />
    <title>Html - 实验室</title>
    <style>
      html,
      body {
        border: 0;
        padding: 0;
        margin: 0;
        height: 100%;
        overflow: hidden;
      }
    </style>
  </head>
  <body>
    <input id="file" type="file" multiple onchange="uploadFile()">
    <div>
        文件信息
        <div id="info"></div>
    </div>
  </body>
  <script>
      function uploadFile(){
        const files = document.getElementById("file").files
        let infoStr = ''
        console.log(files);
        for (let index = 0; index < files.length; index++) {
            const element = files[index];
            infoStr += `name: ${element.name}<br/>
            size: ${element.size}<br/>
            type: ${element.type}<br/><br/>`
        }
        document.getElementById("info").innerHTML = infoStr
      }
  </script>
</html>
